<template>
  <div class="comment">
    <div class="sendComment">
      <textarea name="" id="" cols="30" rows="10"></textarea>
      <button @click="log">发送</button>
    </div>
    <p class="titleFont" @click="log">精彩评论</p>
    <div class="CommentContent">
      <div v-for="(item, i) in props.comment" :key="i">
        <img :src="item.avatarUrl" alt="" />
        <div>
          <p>
            <span>{{ item.nickname }}:</span>{{ item.content }}
          </p>
          <p>{{ item.time }}</p>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
const props = defineProps<{ comment: comment[] }>();
const log = () => {
  1;
};
</script>

<style scoped lang="less">
.comment {
  width: 100%;
  .sendComment {
    width: 100%;
    box-sizing: border-box;
    height: 170px;
    padding: 19px 12px 12px;
    background-color: #f0f0f2;
    text-align: right;
    textarea {
      width: 98.5%;
      height: 80px;
      border: 0;
      outline: none;
      padding: 10px;
    }
    button {
      border: 0;
      margin: 5px 0 10px;
      padding: 5px;
      width: 50px;
      height: 30px;
      border: 1px solid;
      border-radius: 5px;
      background-color: deeppink;
    }
  }
  .CommentContent {
    > div {
      display: flex;
      align-items: center;
      margin: 10px 0;
      > img {
        width: 50px;
        height: 50px;
        border-radius: 10px;
      }
      > div {
        height: 50px;
        margin-left: 10px;
        display: flex;
        flex-direction: column;
        justify-content: space-around;
        p {
          span {
            color: #2d8cf0;
            margin-right: 5px;
          }
        }
      }
    }
  }
}
</style>
